package com.hisense.ovcloud.apicontrol.errors;

public enum ErrorCodes {
    //服务器内部错误
    SERVER_ERROR(101000, "Server Error."),

    SIGN_CHECK_FAIL(101001, "Signature check fail."),
    PARAM_FORMAT_ERROR(101002, "Param format error."),
    PARAM_ERROR_INVALID(101003, "Request parameter content error:%s "),
    TIMESTAMP_CHECK_FAIL(101004, "Timestamp check fail."),
    NONCE_CHECK_FAIL(101005, "randStr check fail."),
    NO_APP_SECRET_FOUND(101006, "there is no appSecret found for the appId."),
    NO_APP_SECRET_FOUND_FROM_AUTH_SERVICE(101007, "no appSecret found from auth-service."),
    APPID_IS_NOT_INTERNAL(101008, "this appId can only be used INTERNALLY."),
    ;
    private int code;
    private String desc;

    private ErrorCodes(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int value() {
        return this.code;
    }

    public String desc() {
        return this.desc;
    }

    public String desc(String param) {
        return String.format(this.desc, param);
    }
}
